// ExtractingState.java
class ExtractingState implements State {
    @Override
    public void handleChar(StringExtractor extractor, char c) {
        if (c == '"') {
            // 字符串结束
            String result = extractor.getCurrentString();
            extractor.addString(result);
            extractor.clearCurrentString();
            extractor.setState(new InitialState());
        } else if (c == '\\') {
            // 进入转义状态
            extractor.setState(new EscapingState());
        } else {
            // 普通字符，直接添加
            extractor.appendChar(c);
        }
    }
}